﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;

namespace igflow
{
    public static class Input
    {
        static GamePadState currentGamepadState;
        static GamePadState oldGamepadState;
        public static void Update()
        {
            oldGamepadState = currentGamepadState;
            currentGamepadState = GamePad.GetState(PlayerIndex.One, GamePadDeadZone.Circular);
        }

        public static bool Right()
        {
            if( currentGamepadState.ThumbSticks.Left.X > 0.5f && oldGamepadState.ThumbSticks.Left.X < 0.5f )
            {
                return true;
            }
            return false;
        }

        public static bool Left()
        {
            if (currentGamepadState.ThumbSticks.Left.X < -0.5f && oldGamepadState.ThumbSticks.Left.X > -0.5f)
            {
                return true;
            }
            return false;
        }

        internal static Vector2 LeftStick()
        {
            return currentGamepadState.ThumbSticks.Left;
        }

        internal static Vector2 RightStick()
        {
            return currentGamepadState.ThumbSticks.Right;
        }
    }
}
